SAP Accounts Payable System API - Implementation Template
Setup guide
Importing Templates into Anypoint Studio
- In Studio, click the Exchange X icon in the upper left of the taskbar.
- Log in with your Anypoint Platform credentials.
- Search for the template.
- Click Open.
Running Templates in Anypoint Studio
After you import your template into Studio, follow these configuration steps to run it.
HLS SAP Accounts Payable System API Application Configuration
The application requires a few things to be configured, mainly the system API connection information. Configure them in the properties file located in the config
folder.
mule.env
is the environment where the application is to be deployed. For a studio deployment, the recommended mule.env value islocal
.mule.encryptionKey
is the encryption key for securing sensitive properties.sap.hana.url
is the SAP S/4HANA URL.sap.hana.username
is the username for connecting to SAP S/4HANA.sap.hana.password
is the username for connecting to SAP S/4HANA.sap.hana.createJournalEntry.path
is the service name for SAP S/4HANA SOAP API.sap.hana.createJournalEntry.operation
is the operation name for SAP S/4HANA Cloud SOAP API.sap.hana.createJournalEntry.request.referenceDocumentType
is the default for reference document type.sap.hana.createJournalEntry.request.transactionType
is the default for transaction type.sap.hana.createJournalEntry.request.accountingDocumentType
is the accounting document type. KR for vendor invoice, DG for customer credit memo etc.sap.hana.createJournalEntry.request.documentHeaderText
is the default for document header text.sap.hana.createJournalEntry.request.createdBy
is the default for createdBy.sap.hana.createJournalEntry.request.companyCode
is the default for company code.sap.hana.createJournalEntry.request.glAccount
is the default for GL Account.sap.hana.createJournalEntry.request.currencyCode
is the default for currency code.sap.hana.createJournalEntry.request.itemDebitCreditCode
is the default for DebitOrCreditCode for creditor item.sap.hana.createJournalEntry.request.documentItemText
is the default for item text for creditor item.sap.hana.createJournalEntry.request.accountAssignmentType
is the default for account assignment type.sap.hana.createJournalEntry.request.profitCenter
is the default for profit center.sap.hana.createJournalEntry.request.costCenter
is the default for cost center.sap.hana.createJournalEntry.request.referenceDocumentItem
is the default for reference document item for debtor item.sap.hana.createJournalEntry.request.debtorItemDebitCreditCode
is the default for DebitOrCreditCode for debtor item.sap.hana.getPayments.service
is the service name for SAP S/4HANA connector.sap.hana.getPayments.unlistedServicesDirectory
is the unlisted services directory in SAP S4 HANA Configuration.sap.hana.getPayments.defaultQueryParam.key
is the default query param key for SAP S4 HANA Configuration.sap.hana.getPayments.defaultQueryParam.value
is the default query param value for SAP S4 HANA Configuration.sap.hana.getPayments.entity
is the entity type for SAP S4 HANA Query connector.sap.hana.getPayments.orderBy
is the order by field for data returned by SAP S4 HANA Query connector.sap.hana.getPayments.queryParams.dateField
is the SAP parameter name for ClearingDate.sap.hana.getPayments.queryParams.documentHeaderText
is the SAP parameter name for DocumentHeaderText.sap.hana.getPayments.queryParams.journalEntryId
is the SAP parameter name for AccountingDocument.sap.hana.getPayments.queryParams.glAccount
is the SAP parameter name for GLAccount.sap.hana.getPayments.queryParams.customer
is the SAP parameter name for Customer.
Please refer to the attached link on how to secure the configuration properties.
HTTPS Configuration
https.host
— sets the service host interface. It should be configured inconfig-<mule.env>.yaml
file. (Defaults to 0.0.0.0 for all interfaces).https.port
— sets the HTTPS service port number. It should be configured inconfig-<mule.env>.yaml
file. (Default 8082).- TLS Configuration - Keystore properties setup:
keystore.alias
- sets the alias to the keystore. It should be configured inconfig-<mule.env>.yaml
file.keystore.path
- sets the path to the key file. Key should be available in /src/main/resources/keystore. It should be configured inconfig-<mule.env>.yaml
file.keystore.keypass
— sets keystore keypass to support HTTPS operation. It should be encrypted and configured inconfig-secured-<mule.env>.yaml
file.keystore.password
— sets keystore password to support HTTPS operation. It should be encrypted and configured inconfig-secured-<mule.env>.yaml
file.
Please refer to the attached link on how to generate the Keystore.
Constraints and Limitations
Listed below are a few of the constraints and limitations for the template:
- DataWeave mapping for Create JournalEntry has implementation for the minimum necessary fields to successfully create a journal entry in SAP S/4HANA.
- Limited set of query parameters implemented for SAP S/4HANA payments. Template can be extended to all parameters supported by SAP.
Tested and verified
This solution was developed and tested on Anypoint Studio 7.15 and Mule Runtime 4.4.0.
Running it
- Right-click the template project folder.
- Hover your mouse over 'Run as'.
- Click Mule Application (configure).
- Inside the dialog, select Environment and set the variable mule.env to the appropriate value (e.g., dev or local).
- Inside the dialog, select Environment and set the variable mule.key to the property encryption key that you used to encrypt your secure properties.
- Click Run.
Deployment instructions for CloudHub using provided scripts
Ensure the Maven profile CloudHub-DEV
has been properly configured in your settings.xml
file. Reference can be found by downloading the Accelerator Common Resources asset. Additional instructions are available in the Getting Started with MuleSoft Accelerators - Build Environment guide.
Update the config-<env>.yaml
properties appropriately and then use one of the following scripts to deploy the application to Cloud Hub:
- packageDeploy.sh or deployOnly.sh (Mac/Linux).
- packageDeploy.cmd or deployOnly.cmd (Windows).
Test the template
- Use Advanced Rest Client or Postman to send a request over HTTPS. The template includes a Postman collection in the
src/test/resources
folder.